// (c) Copyright 2013 Mike Riedel.
// This source is subject to the Microsoft Public License (Ms-PL).
// All other rights reserved.

using System;

namespace FreshMeat.ErrorHandlingBlock
{
   /// <summary>
   /// Event arguments for feedback.
   /// </summary>
   public class FeedbackEventArgs : EventArgs
   {
      /// <summary>
      /// Optional state supplied when action was run or null.
      /// </summary>
      public object State { get; set; }

      /// <summary>
      /// Error that occurred.
      /// </summary>
      public Exception Error { get; set; }

      /// <summary>
      /// The number of attempts that have occurred.
      /// </summary>
      public int Attempt { get; set; }

      /// <summary>
      /// Creates instance.
      /// </summary>
      public FeedbackEventArgs(object state, Exception error, int attempt)
      {
         State = state;
         Error = error;
         Attempt = attempt;
      }
   }
}